﻿@model ArivisTests.Models.TestResult
@{
    List<string> knownColors = ViewBag.KnownColors;
    var colorListItems = knownColors.Select(x => new SelectListItem { Value = x, Text = x });
}

@section Navigation{
    @Html.ActionLink("Configuration", "Index", "Config")
    &rsaquo;
    @Html.ActionLink("Results", "Results", "Config")
    &rsaquo;
    Create New
}


@using (Html.BeginForm("AddResult", "Config")) {
    <fieldset>
        <legend>New Result</legend>

        <table class="editor-table">
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Name)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.Name)
                    @Html.ValidationMessageFor(model => model.Name)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Color)
                </td>
                <td class="editor-field">
                    @Html.DropDownListFor(model => model.Color, colorListItems, "")
                    @Html.ValidationMessageFor(model => model.Color)
                </td>
            </tr>
        </table>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}
